<%@page contentType="text/html; GB2312" %>
<%
    String contextPath = request.getContextPath();
%>
<html>
<head>
    <title>test ajax service</title>
    <meta http-equiv=Content-Type content="text/html; charset=gb2312">
    <meta http-equiv="Content-Language" content="zh-CN"/>
    <meta content="all" name="robots"/>
    <script type="text/javascript" language="JavaScript" src="<%=contextPath%>/lib/default/scripts/prototype.js"></script>
    <script type="text/javascript" language="JavaScript" src="<%=contextPath%>/lib/default/scripts/buffalo.js"></script>
    <script type="text/javascript" language="JavaScript">
        var endPoint = "<%=contextPath%>/ajaxapp/";
        var buffalo = new Buffalo(endPoint);
        function submitIt() {
            var obj = {};
            buffalo.remoteCall("LoginService.login", [obj], dealUpdate);
        }

        dealUpdate = function(reply) {
            var result=reply.getResult();
            alert(Object.isString(result));
            for(var i=0;i<result.length;i++){
                alert(result[i]);
                var ttt=result[j].split(",");
                for(var j=0;j<ttt.length ; j++){
                    alert(ttt[j]);
                }
            }
        }
    </script>
</head>

<body>
<input  type="button" value="ClickIt" onclick="submitIt();"/>

        <select id="provinces" jtext="name" jvalue="value"></select>
</body>
<script type="text/javascript">

/* Data */
var data = [{name: "Hu Bei", value:"HB"} ,{name: "Shan Xi", value:"SX"}]

/* Binding */
Buffalo.Bind.bind("provinces", data);
</script>
</html>